$(function () {
	/**根据登录用户加载菜单*/
	var menu = new Object();
	if (ctx == '/') ctx = '';
	$.ajax({
		url : ctx + "/getMenu",
		type:"post",
		//data: {'ids' : ids},//传值
		dataType:"json",
		contentType: "application/json",
		traditional: true,
		async : false,//异步请求
		success:function(result) {
			if (result.code === 200) menu = result.data;
			else layer.msg('无菜单权限,请联系管理员', {offset: '15px', time: 3000, icon: 1});
		}
	});
	//$.LanaiMenu(menu, { EnableNav: true });//默认为顶端导航
	$.LanaiMenu(menu, { EnableNav: $('[data-enableNav="toggle"]:checked').length > 0 });

    $('[data-enableNav="toggle"]').change(function () {
        $.LanaiMenu(menu, { EnableNav: $('[data-enableNav="toggle"]:checked').length > 0 })
    });
})